
package com.sunwayhorizo.health.business.registries.organization;

import java.util.List;

import javax.ejb.Local;

import com.sunwayhorizo.health.business.base.IBaseManager;
import com.sunwayhorizo.health.business.dto.ResultsDTO;
import com.sunwayhorizo.health.business.dto.registries.DepartmentDTO;
import com.sunwayhorizo.health.hl7.common.Hl7Exception;
import com.sunwayhorizo.health.hl7.rim.Organization;
import com.sunwayhorizo.health.hl7.rim.Role;

/**
 * 
 * @ClassName DepartmentManagerLocal <br>
 * @PackageName com.sunwayhorizo.health.business.registries.organization <br>
 * @Description 科室管理 <br>
 * @Author jinzw <br>
 * @Date 2011-1-2 <br>
 * @Version 1.0 <br>
 * @ModifiedDesc <br>
 * @ModifiedDate <br>
 * @ModifiedBy <br>
 * @Email jinzw@sunwaysoft.com.cn <br>
 * @Copyright 2010-2020 horizo All Rights Reserved. <br>
 */
@Local
public interface DepartmentManagerLocal extends IBaseManager {
	
	/**
	 * 新增Department
	 * @param entitiesDTO  departmentDTO DTO
	 * @return
	 * @throws Hl7Exception
	 */
	public ResultsDTO newDepartment(DepartmentDTO departmentDTO) throws Hl7Exception;
	
	/**
	 * 批量删除Department
	 * @param ids
	 * @return
	 * @throws Hl7Exception
	 */
	@SuppressWarnings("rawtypes")
	public ResultsDTO delDepartment(List  depIds) throws Hl7Exception;
	
	/**
	 * 更新Department
	 * @param entitiesDTO
	 * @return
	 * @throws Hl7Exception
	 */
	public ResultsDTO updateDepartment(DepartmentDTO  entitiesDTO) throws Hl7Exception;
	
	/**
	 * 验证科室编码是否重复
	 * @param code 科室编码
	 * @return 0：存在 1：不存在
	 * @throws Hl7Exception
	 */
	public ResultsDTO validateDeptCode(String code) throws Hl7Exception;
	
	/**
	 * 查询树(机构与科室【科室、工作组】)
	 * 加载启用 未启用的科室
	 * @param orgId  机构Id
	 * @return
	 * @throws Hl7Exception
	 */
	public ResultsDTO findDepartmentTree(String orgId)throws Hl7Exception;
	
	/**
	 * 查询树，加载启动的科室
	 * @param orgId
	 * @return
	 * @throws Hl7Exception
	 */
	public ResultsDTO findActiveDepartmentTree(String orgId) throws Hl7Exception;
	
	/**
	 * 只查询行政科室tree
	 * @param orgId 机构id
	 * @return
	 * @throws Hl7Exception
	 */
	public ResultsDTO findOnlyDepartmentTree(String orgId) throws Hl7Exception;
	
	/**
	 * 查询所有的工作组列表
	 * @return ResultsDTO
	 * @throws Hl7Exception
	 */
	public ResultsDTO findWorkGroupList() throws Hl7Exception;
	
	/**
	 * 查询所有的病区
	 * @return ResultsDTO
	 * @throws Hl7Exception
	 */
	public ResultsDTO findInHospitalWorkGroupList() throws Hl7Exception;
	
	/**
	 * 查询所有的诊室
	 * @return
	 * @throws Hl7Exception
	 */
	public ResultsDTO findOutHospitalWorkGroupList() throws Hl7Exception;
	
	/**
	 * 根据科室类型查询对应的工作组
	 * @param codingSchemesEnName
	 * @param conceptCode
	 * @return
	 * @throws Hl7Exception
	 */
	public ResultsDTO findWorkGroupListByType(String codingSchemesEnName,String conceptCode) throws Hl7Exception;
	 
	
	/**
	 * 构造科室DTO
	 * @param entitys 科室/机构/工作组实体
	 * @return DepartmentDTO
	 * @throws Hl7Exception
	 */
	public DepartmentDTO convertDepartmentDTO(Organization entitys) throws Hl7Exception;
	
	/**
	 * 根据科室角色构造科室DTO
	 * @param role
	 * @return
	 * @throws Hl7Exception
	 */
	 public DepartmentDTO converDepartmentDTOByDeptRole(Role role) throws Hl7Exception;
	
}


